﻿--[[
   @brief    desc for webgame mainframe
   @author   hqzheng
   @version  1.0
   @date     2017-4-12
--]]

wegame_mainframe_desc =
{
    module_name = "wegame_mainframe",
    events = 
    {
        {
            c_event = 
            {
                {
                    -- 登陆tgp服务器是否成功
                    id = ierd_tgp.login_mgr.LOGIN_ON_LOGIN_SRV_STATE,
                    callback = "wegame_mainframe_control.set_login_srv_state"
                },
                {
                    id  = ierd_tgp.login_mgr.LOGIN_ON_KICK_OFF,
                    callback = "wegame_mainframe_control.handle_blacklist_user_notify"
                },
                {
                    id  = ierd_tgp.login_mgr.LOGIN_ON_LOGIN_BEGIN,
                    callback = "wegame_mainframe_control.load_resource"
                },
            },

            lua_event = 
            {
                {
                    id = banner_event.FOCUS_BANNER_ITEM,
                    callback = "wegame_mainframe_control.jump_module_page"
                },

                {
                    id = banner_event.FOCUS_BANNER_ITEM,
                    callback = "helper_mgr_control.handle_banner_switch"
                },

                {
                    id = main_web_event.ON_JS_CALLBACK_TO_MAINFRAME,
                    callback = "wegame_mainframe_control.on_js_callback"
                },

                {
                    id = mainframe_event.SHOW_MAIN_WND,
                    callback = "wegame_mainframe_control.restore_main_wnd"
                }
                ,
--                {
--                    id = group_event.CLEAR_MSG_BOX_NOTIFY_REDDOT,
--                    callback = "tools_panel.clear_msg_box_notify_reddot"
--                },

            },
            reg_service = 
            {
                {
                    id = 'service_main_top_get_tgp_level',
                    callback = 'wegame_mainframe_control.get_tgp_level'
                },
                {
                     id = 'service_page_cache_switch_change',
                     callback = "wegame_mainframe_control.handle_page_cache_switch_change"
                },
            },
            listen_broadcast = 
            {
                {
                    id = "Msg_ShowBlackListUserNotify",
                    callback = "wegame_mainframe_control.handle_blacklist_user_notify"
                 },
                 {
                    id = 'Msg_WeGame_Auto_Exit',
                    callback = "wegame_mainframe_control.auto_exit_main_process"
                 },
                 {
                    id = 'Msg_UpdateStartForGame',
                    callback = "wegame_mainframe_control.update_start_for_game"
                  },
                  {
                      id = 'Msg_OnSecScanEnd',
                      callback = "wegame_mainframe_control.load_resource"
                  }
            },
            lua_file = "wegame_mainframe\\control.lua"
        },
        {
            reg_service = 
            {
                {
                    id = "i_service_msg_box_get_unread_msg_count",
                    callback = "msg_box_frame_control.handle_get_unread_msg_count"
                },
                {
                    id = 'i_service_mainframe_get_current_mode',
                    callback = 'wegame_mainframe_control.get_current_mode'
                },
            },
            lua_file = "wegame_mainframe\\web_operation.lua"
        },
        
    }
};

desc_mgr.add(wegame_mainframe_desc);
ierd_tgp.tpf_ui.Require("wegame_mainframe\\control.lua");
ierd_tgp.tpf_ui.Require("helper_mgr\\control.lua");